package fun.werfamily.wf.order.core.infrastructure.mapper;


import fun.werfamily.wf.order.core.domain.dto.req.OrderListReqDTO;
import fun.werfamily.wf.order.core.domain.dto.req.OrderReqDTO;
import fun.werfamily.wf.order.core.domain.dto.result.OrderCount;
import fun.werfamily.wf.order.core.infrastructure.dataobject.OrderDO;

import java.util.List;

public interface OrderMapper {
    int deleteByPrimaryKey(Long id);

    int insertSelective(OrderDO record);

    OrderDO selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(OrderDO record);

    /**
     * 根据订单号查询
     * @param orderReqDTO
     * @return
     */
    OrderDO selectByOrderNo(OrderReqDTO orderReqDTO);

    /**
     * 根据用户编码查询订单列表
     * @param orderListReqDTO
     * @return
     */
    List<OrderDO> listByUserCodeAndStatus(OrderListReqDTO orderListReqDTO);

    /**
     * 统计总条数
     * @param orderListReqDTO
     * @return
     */
    int countByUserCodeAndStatus(OrderListReqDTO orderListReqDTO);

    /**
     * 订单信息统计
     * @param userCode
     * @return
     */
    List<OrderCount> orderStatistics(String userCode);
}